import {LIST_DATA} from './actionTypes.js'
import axios from 'axios'
import {SCROLL_VIEW} from "../../../component/ScrollView/scrollViewActionsType";

export const getListDate = (page) => (dispatch) => {
  dispatch({
    type: SCROLL_VIEW,
    obj: false
  })
  axios({
    method: 'get',
    url: '/json/homelist.json'
  }).then((resp) => {
    dispatch({
      type: LIST_DATA,
      currentPage: page,
      obj: resp.data
    })
    dispatch({
      type: SCROLL_VIEW,
      obj: true
    })
  })
}